package com.wcar.sale.feign.factory;

import com.wcar.common.entity.Menu;
import com.wcar.common.entity.User;
import com.wcar.common.vo.Result;


import com.wcar.sale.feign.UserFeign;
import feign.hystrix.FallbackFactory;

import java.util.List;

public class UserFeignFactory implements FallbackFactory<UserFeign> {
    @Override
    public UserFeign create(Throwable throwable) {
        return new UserFeign() {
            @Override
            public Result<List<Menu>> queryTreeByUserId() {
                return new Result<List<Menu>>(500,throwable.getMessage(),null);
            }

            @Override
            public Result addMenu(Menu menu) {
                return new Result<List<Menu>>(500,throwable.getMessage(),null);
            }

            @Override
            public Result deleteMenu(Integer menuId) {
                return new Result<List<Menu>>(500,throwable.getMessage(),null);
            }

        };
    }
}
